package com.itheima.huikebackend.utils;

import com.itheima.huikebackend.exception.ExceptionMessage;
import com.itheima.huikebackend.exception.LoginException;

import java.util.Objects;


public class AuthUtils {

    /**
     * 是否是管理员
     * @param id
     * @return
     */
    public static Boolean isAdmin(Integer id) {
        if (Objects.isNull(id)) {
            throw new LoginException(ExceptionMessage.NO_AUTH);
        }
        return id.equals(1);
    }

}
